<!DOCTYPE html>
<html lang="en">
<head>
<title>漂亮的响应式Bootstrap后台管理系统模板MatAdmin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/bootstrap.min.css" />
<!-- <link rel="stylesheet" href="__ROOT__/PUBLIC/css/bootstrap-responsive.min.css" /> -->
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/fullcalendar.css" />
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/matrix-style.css" />
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/matrix-media.css" />
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/index.css" />
<link href="__ROOT__/PUBLIC/font-awesome/css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" href="__ROOT__/PUBLIC/css/jquery.gritter.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<script src="__ROOT__/PUBLIC/js/jquery-1.8.0.min.js"></script> 
    <style type="text/css">
		#allmap{width:100%;height:450px;}
	</style>
	<style>
        html, body, #container {
            height: 100%;
            width: 100%;
        }

        .amap-icon img,
        .amap-marker-content img{
            width: 25px;
            height: 34px;
        }

        .marker {
            position: absolute;
            top: -20px;
            right: -118px;
            color: #fff;
            padding: 4px 10px;
            box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
            white-space: nowrap;
            font-size: 12px;
            font-family: "";
            background-color: #25A5F7;
            border-radius: 3px;
        }

        .input-card{
            width: 18rem;
            z-index: 170;
        }

        .input-card .btn{
            margin-right: .8rem;
        }

        .input-card .btn:last-child{
            margin-right: 0;
        }
    </style>
   
<style>

.parent {
	display: block;	
	height:0px;
    padding-bottom:100%
}

.parent {
	 writing-mode: horizontal-tb; 
}

.child {
	margin: 10px 10px 10px 10px;
	border: 5px solid black;
	padding: 5px;
	width: 450px;
	height: 750px;
	text-align: center;
	background: lightblue;
	writing-mode: horizontal-tb;
	display: inline-block;
}
</style>

<style>
#newwwf{position:relative;width:100%;height:1200px;border:2px solid #000;margin:10px auto;overflow:hidden;}
#allmap,#bottom{height:700px;overflow:hidden;}
#line{position:absolute;top:58%;width:100%;height:4px;overflow:hidden;margin-top:-2px;background:red;cursor:n-resize;}
</style>

<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hNx4DUGHj4NRfZZIlfmSkkaxpwe1r8Zj"></script> -->
	  <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=9236cca4395c6f2a6e7dbd58677501c5&plugin=AMap.Geocoder"></script>   
</head>
<body>
        
<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">MatAdmin</a></h1>
</div>
<!--close-Header-part-->
<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
    <li  class="dropdown" id="profile-messages" ><a title="" href="#" data-toggle="dropdown" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i>  <span id="userbeifn" class="text">{$user}</span><b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i> 我的资料</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> 我的任务</a></li>
        <li class="divider"></li>
        <li><a href="{:U('Login/logout')}"><i class="icon-key"></i> 退出</a></li>
      </ul>
    </li>
    <li class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> 新消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> 发送</a></li>
      </ul>
    </li>
    <li class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">设置</span></a></li>
    <li class=""><a title="" href="{:U('Login/logout')}"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<div id="search">
  <input type="text" placeholder="输入搜索内容..."/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
<!--close-top-serch-->
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon-home"></i> 控制台</a>
  <ul>
    <!-- <li><a href="{:U('Index/index')}"><i class="icon-home"></i> <span>首页</span></a> </li>
    <li> <a href="{:U('Log/index')}"><i class="icon-signal"></i> <span>库存单品编码</span></a> </li>
    <li class="active"> <a href="{:U('Lsdl/index')}"><i class="icon-signal"></i> <span>客户门店添加</span></a> </li>
    <li> <a href="{:U('Ls/index')}"><i class="icon-signal"></i> <span>门店报单编辑</span></a> </li>
    <li> <a href="{:U('Lsrb/index')}"><i class="icon-signal"></i> <span>已报订单确认</span></a> </li>
    <li> <a href="{:U('Nslsrb/index')}"><i class="icon-signal"></i> <span>日报新增删除</span></a> </li>
    <li > <a href="{:U('Sc/index')}"><i class="icon-signal"></i> <span>商超批量派车</span></a> </li>
    <li> <a href="{:U('Scdl/index')}"><i class="icon-signal"></i> <span>商超独立派车</span></a> </li>
    <li> <a href="{:U('Wpcmd/index')}"><i class="icon-signal"></i> <span>未派订单处理</span></a> </li> -->
  </ul>
</div>
<!--sidebar-menu-->

<!--main-container-part-->
<div id="content">
<!--breadcrumbs-->
  <div id="content-header">
    <div id="f"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a></div>
  </div>
<!-- End-breadcrumbs -->

<!-- Action boxes -->

  <div id="newwwf" class="" >
    <div id="allmap"></div> 
    <div id="bottom"> 
    <div> 
    <!-- <form action="{:U('lsdl/upfile')}" enctype="multipart/form-data" method="post">
	 <input type="file" name="photo" /> <input type="submit" value="提交">
    </form> -->
   <!--  <button id="fbt6">加载配送信息</button>
    <button id="fbt1">追加</button>
	<button id="fbt2">删除</button>
	<button id="fbt3">保存</button>
	<button id="fbt4">预览</button>
	<button id="fbt5">提交</button>
	<button id="fbt7">提交并保存</button>
	<button id="fbt9">无订单派车</button>
	<button id="fbt8">删除缓存</button> -->
	客户:<input id="khm" type="text" value="cmxm">
	门店:<input id="md" type="text" value="">
	收货人:<input id="shr" type="text" value="">
	电话:<input id="shrdh" type="text" value="">
	<br>
	地址:<input id="dz" class="span8" type="text" value="">
	<br>
	经度:<input id="jwdcs" type="text" value="">
	纬度:<input id="jwdcs1" type="text" value="">
	<button id="fbt1">提交</button>
	<hr>
	<p>编辑客户信息</p>
	<form action="{:U('lsdl/index')}" enctype="multipart/form-data" method="post">
	<input type=submit class="span1" name=submit value=查询> 	
	</form>
    <button id="fbt11">删除</button>
	<button id="fbt22">提交</button>
	</div>       
    <div  class="parent pre-scrollable"   style="overflow:auto;position: relative">
    <div  id="wwf">  
                           <table id=tablea class="table table-bordered table-striped" >							
							<thead>
							<tr>
							    <th><nobr>选中</nobr></th>
							    <th><nobr>客户名称</nobr></th>
							    <th><nobr>门店</nobr></th>
							    <th><nobr>收货人</nobr></th>
							    <th><nobr>收货人电话</nobr></th>
							    <th><nobr>收货地址</nobr></th>
							    <th><nobr>经度</nobr></th>
							    <th><nobr>纬度</nobr></th>							    						 
							</tr>
							</thead>
							<tbody>
							<volist name="arr1" id="vo">
							<tr>
							    <th><input type=checkbox name=selected_book_id[] value={$vo.0}></th>						
								<td><nobr>{$vo.1}</nobr></td>								
								<td><nobr>{$vo.2}</nobr></td>
								<td><nobr>{$vo.3}</nobr></td>								
								<td><nobr>{$vo.4}</nobr></td>
								<td><nobr>{$vo.5}</nobr></td>
								<td><nobr>{$vo.6}</nobr></td>
								<td><nobr>{$vo.7}</nobr></td>
																														
							</tr>
							</volist>	
							</tbody>							
						</table>  
	</div>    
	</div>   
	</div>
	<div id="line"></div>
  </div>
<!-- End-Action boxes -->    

</div>

<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid">
  <div id="footer" class="span12">Copyright &copy; 2018.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a> </div>
</div>


<script src="__ROOT__/PUBLIC/js/excanvas.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.ui.custom.js"></script> 
<script src="__ROOT__/PUBLIC/js/bootstrap.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.flot.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.flot.resize.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.peity.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/fullcalendar.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.dashboard.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.gritter.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.interface.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.chat.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.validate.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.form_validation.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.wizard.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.uniform.js"></script> 
<script src="__ROOT__/PUBLIC/js/select2.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.popover.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.dataTables.min.js"></script> 
<script src="__ROOT__/PUBLIC/js/matrix.tables.js"></script> 
<script src="__ROOT__/PUBLIC/js/numeric-input-example.js"></script> 
<script src="__ROOT__/PUBLIC/js/mindmup-editabletable-rb.js"></script> 
<script src="__ROOT__/PUBLIC/js/jquery.mousewheel.js"></script>
<!--end-Footer-part-->
<script type="text/javascript">
 function wwe(id) {
	
	return document.getElementById(id);
	
} 
window.onload = function() {
	
	var oBox = wwe("newwwf"), oTop = wwe("allmap"), oBottom = wwe("bottom"), oLine = wwe("line");
	oLine.style.top=oTop.style.height;
	oLine.onmousedown = function(e) {
		
		//保存当前鼠标点击时的 y值。
		var disY = (e || event).clientY;
		//保存oLine到父元素的距离。
		oLine.top = oLine.offsetTop;
		//鼠标上下移动时的事件响应。
		document.onmousemove = function(e) {		
			//oLine的top值加上（当前鼠标移动后的y值减去鼠标点击按下时的y值），这个结果应该是oline的新y值。
			//oLine的原始高度加上鼠标的位置变化，就是新的y值。
			var iT = oLine.top + ((e || event).clientY - disY);			
			
			//上div y的最大值 395-396之间
			var maxT = oBox.clientHeight - oLine.offsetHeight;			
			
			//oLine的四个外边距为0
			oLine.style.margin = 0;
			
			//如果iT小于0 iT就等于0；大于maxT就等于maxT。
			iT < 0 && (iT = 0);
			iT > maxT && (iT = maxT);
			
			oLine.style.top = oTop.style.height = iT + "px";
			oBottom.style.height = oBox.clientHeight - iT + "px";
			return false;
		};	
		document.onmouseup = function() {
			document.onmousemove = null;
			document.onmouseup = null;	
			oLine.releaseCapture && oLine.releaseCapture()
		};
		oLine.setCapture && oLine.setCapture();
		return false;
	};
};
</script>
<script type="text/javascript">
//ajax 测试
$.post("__CONTROLLER__/ceshi/",
		    {
		    
		    },
		    function(data,status){	
		    	switch (data) 
		    	{		    	
		        case "1":
		    	{
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Index/index')}'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Log/index')}'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='{:U('Lsdl/index')}'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Ls/index')}'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Lsrb/index')}'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Dddy/index')}'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");   	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Rkcl/index')}'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Ddgz/index')}'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Kcgl/index')}'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");
		        	break;
		    	}
		    	
		        case "2":
		    	{
		        	$('#sidebar').children("ul").append("<li><a href='{:U('Index/index')}'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Log/index')}'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li class='active'> <a href='{:U('Lsdl/index')}'><i class='icon-signal'></i> <span>客户门店添加</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Ls/index')}'><i class='icon-signal'></i> <span>门店报单编辑</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Lsrb/index')}'><i class='icon-signal'></i> <span>已报订单确认</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Kcgl/index')}'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");  
		        break;
		    	}
		    	
		        case "3":
		    	{ 
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Index/index')}'><i class='icon-home'></i> <span>首页</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Log/index')}'><i class='icon-signal'></i> <span>库存单品编码</span></a> </li>");	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Dddy/index')}'><i class='icon-signal'></i> <span>订单打印处理</span></a> </li>");   	
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Rkcl/index')}'><i class='icon-signal'></i> <span>单品入库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Ddgz/index')}'><i class='icon-signal'></i> <span>订单出库处理</span></a> </li>");
		        	$('#sidebar').children("ul").append("<li> <a href='{:U('Kcgl/index')}'><i class='icon-signal'></i> <span>库存数据查看</span></a> </li>");  	
		        break;
		    	}
		    	
		        case "4":
		        {    	    	
		        	
		        break;
		        } 
		        
		        default: 
		        {
		    	break;
		        }
		        
		    	} 
		    	//$("#sidebar").find("li")[0].remove();    
		    });
/////////////////////////////////////////////////////////////////////////
//高德地图点选，拾取经纬度和地址。
/////////////////////////////////////////////////////////////////////////

    var a=113.65;	
    var b=34.76;
	var map = new AMap.Map('allmap', {
		resizeEnable: true,
		zoom : 11,//级别
		center : [ a, b ],//中心点坐标
	}); 
		
	var geocoder = new AMap.Geocoder({
	        city: "0371", //城市设为北京，默认：“全国”
	        radius: 1000 //范围，默认：500
    });
   
	function regeoCode(lnglat) {		
        geocoder.getAddress(lnglat, function(status, result) {
            if (status === 'complete'&&result.regeocode) {
                var address = result.regeocode.formattedAddress;              
                $('#dz').val (address);
            }else{
                alert('根据经纬度查询地址失败')
            }
        });
    } 
    map.on('click', function(e) {
		   $('#jwdcs').val(e.lnglat.getLng());
		   $('#jwdcs1').val(e.lnglat.getLat());
		   regeoCode(e.lnglat.getLng()+','+e.lnglat.getLat());	       
	    }); 
//////////////////////////////////////////////////////////////////////////
//这里可以设定 时间少于某一时刻禁止 提交新订单。
 $('#fbt1').click(function(){
	
    	var r=confirm("是否提交!");
 		if (r==true)
 		{
 		if($('#khm').val()!="" && $('#shr').val()!="" && $('#shrdh').val()!="" && $('#dz').val()!="" && $('#jd').val()!="" && $('#wd').val()!="" && $('#md').val()!=""){
    	 $.post("__CONTROLLER__/ajaxkhtj/", 
    	 		    {
    		         khmc:$('#khm').val(),
    		         mdd:$('#md').val(),
    		         shr:$('#shr').val(),	
    		         shrdh:$('#shrdh').val(),	
    		         shdz:$('#dz').val(),	
    		         jd:$('#jwdcs').val(),	
    		         wd:$('#jwdcs1').val(),
    		         user:$('#userbeifn').text()
    	 		    },
    	 		    function(data,status){	
    	 		          console.log(data);
    	 		    });    	 
         $('#md').val("");
         $('#shr').val("");	
         $('#shrdh').val("");	
         $('#dz').val("");	
         $('#jwdcs').val("");	
         $('#jwdcs1').val("");
    	    alert("已提交!");
 		}else{
 		    alert("有信息为空！");
 		}
    	   
		}
		else
		{
		    alert("未提交!");
		}
     });
 $('#tablea').editableTableWidget();
//删除门店
 $('#fbt11').click(function(){
 
  var  temp2Arr="";//缓存check 
  
  //input:checkbox:checked 选中input下的checkbox的checked选中值。
	 $('#tablea').find("input:checkbox:checked").each(function(){
		
  	   var temp=$(this).val();
  	  
		   temp2Arr=temp2Arr+temp+",";//生成1,2,3这样的id字符串
		   
		   $('#tablea').children('tbody').find("tr").each(function(){ 			   
	      	  if(temp==$(this).find("input:checkbox:checked").val())
	      	  {   	      	 
			   $(this).remove();//先找到table的选中复选框值，再用这个值与table表体中每一行tr中的复选框值比对，两个值相同就删除当前行。   			  
	      	  }
	      	  });//从表格体中查找tr行，并找到每行中check-box的值。   
		   
  	   });
	var temp2=temp2Arr;
	
	
	 $.post("__CONTROLLER__/ajaxsckh/",
		    { 		      
		      arr2:temp2, 		     
		    },
		    function(data,status){ 		    	
		    	    		    	 		    	
		    });	 	 	 
	 alert("删除完成"); 	 
		
	});
//提交修改门店
 $('#fbt22').click(function(){
	 var  temp1Arr="";//缓存td 2个一组。
	 var  temp2Arr="";//缓存input复选框的值，1个一组    id,新增司机id值等于a99999。  
	 var  temp3Arr="";//缓存下拉列表框默认值		 
	   $('#tablea').find("td").each(function(){
		   var temp=$(this).text();
		   temp1Arr=temp1Arr+temp+",";				  
		   });//缓存td
       $('#tablea').find("input").each(function(){	    	  
    	   var temp=$(this).val();	    	  
		   temp2Arr=temp2Arr+temp+",";
    	   }); //缓存input复选框的值，
      
       
    	var temp1=temp1Arr.slice(0,temp1Arr.length-1);//去掉最后一个 逗号 ，
    	var temp2=temp2Arr.slice(0,temp2Arr.length-1);//去掉最后一个 逗号 ，
   
    	
    	$.post("__CONTROLLER__/ajaxmdbjtj/",
    		    { 
    		      arr1:temp1,
    		      arr2:temp2   		     
    		    },
    		    function(data,status){
    		    	
    		    	console.log(data);//配合 var_dump 可以实现对ajax 处理过程的监控。    		    	
    		    	
    		    });	 
    	
    	alert("提交完成");    	
});		

</script>
</body>
</html>
  